package br.ufmg.ubicomp.utils;

import java.util.HashMap;
import java.util.Map;

public class EntityProperties {

	private String name;
	private String type;
	private Map<String, String> properties;
	
	public EntityProperties() {
		properties = new HashMap<String, String>();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Map<String, String> getProperties() {
		return properties;
	}
	
	public String getKind()
	{
		return properties.get("kind");
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("name: " + name);
		sb.append("\ttype: " + type).append("\n");
		for (String k: properties.keySet())
		{
			sb.append(k + ": " + properties.get(k)).append("\n");
		}
		return sb.toString();
	}
	
	public void addProperty(String p, String v)
	{
		properties.put(p, v);
	}

	public String getValue(String key) {
		// TODO Auto-generated method stub
		return properties.get(key);
	}
}
